package com.hzw.saas.api.product.enums;

import java.util.Objects;

/**
 * 产品云类型
 *
 * @author zzl
 * @since 02/19/2021
 */
public enum ProductCloudType {
    SOFT_CLOUD(1, "软件云"),
    TOOL_CLOUD(2, "工具云"),
    COMPUTE_CLOUD(3, "算力云"),
    DATA_CLOUD(4, "数据云"),
    EXP_CLOUD(5, "体验云");

    private final Integer value;
    private final String text;

    ProductCloudType(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    public Integer value() {
        return value;
    }

    public String text() {
        return text;
    }

    public static String text(Integer value) {
        for (ProductCloudType productCloudType : ProductCloudType.values()) {
            if (Objects.equals(productCloudType.value, value)) {
                return productCloudType.text;
            }
        }
        return null;
    }

    public static ProductCloudType instance(Integer value) {
        for (ProductCloudType productCloudType : ProductCloudType.values()) {
            if (Objects.equals(productCloudType.value, value)) {
                return productCloudType;
            }
        }
        return null;
    }

}
